/**
 * 
 */
package com.taobao.wolfwolf.hibernate.service.impl;

import java.util.List;

import com.taobao.wolfwolf.hibernate.dao.DepotDao;
import com.taobao.wolfwolf.hibernate.pojo.Depot;
import com.taobao.wolfwolf.hibernate.pojo.Sitem;
import com.taobao.wolfwolf.hibernate.service.DepotService;

/**
 * @author Tux
 *
 * 创建时间: 2011-5-21 下午08:34:26
 */
public class DepotServiceImpl extends BaseServiceImpl implements DepotService {
	private DepotDao ddao;

	public List<Depot> findAll() {
		try {
			return ddao.findAll();
		} catch(Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public Depot findById(int id) {
		try {
			return ddao.findById(id);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findById(int id)");
		}
		return null;
	}

	public List<Depot> findByName(String name) {
		try {
			return ddao.findByName(name);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findByName(String name)");
		}
		return null;
	}

	public long getTotal()  {
		try {
			return ddao.getTotal();
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at getTotal()");
		}
		return -1;
	}

	public List<Depot> paging(int page, int limit)  {
		try {
			return ddao.paging(page, limit);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at paging(int page, int limit)");
		}
		return null;
	}

	public void setddao(DepotDao ddao) {
		this.ddao = ddao;
	}

	public DepotDao getddao() {
		return ddao;
	}

	public Depot findBySitem(Sitem sitem) {
		try {
			return ddao.findBySitem(sitem);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findByItem(Item item)");
		}
		
		return null;
	}
}
